home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 12
/
Mac Magazin and MacEasy Magazine CD - Issue 12.iso
/
CD Extras
/
Plug-ins
/
SODAColor
/
SODA-PlugIns-1
/
Plug-In-Collection-1
/
Exploding Text
next >
Wrap
Text File
|
1994-11-07
|
9KB
|
188 lines
--SODABuildPlug
--Exploding Text
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
SODAColor™
Exploding Text Button :
This plug-in allows you to create buttons in SODAColor which display TEXT which shrinks or expands
LOADING THIS SCRIPT INTO SODACOLOR:
1. Select "Load New Plug-In" from the plug-in list (TV-icon on edit palette).
2. Select this document.
USING THIS PLUG-IN:
1. Type in the message you want to display.
2. Draw the rectangle in which you want the button to appear.
3. Edit font, message, and style properties by shift-clicking the button.
4. As ususal, option-click to reposition, command-click to delete.
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
on mouseUp
put "This plug-in allows you to create a button which displays shrinking or expanding text." into myprompt
put "Do you want to create this?" into prompt2
answer myPrompt&return&return&prompt2 with "Cancel" or "Build it!"
if it is "Cancel" then exit mouseUp
put buildScript() &return into myScript
if myScript is empty then exit mouseUp
put "Display what message?"into myPrompt
repeat forever
ask myPrompt with "Hello World!"
if it is empty then exit to HyperCard
put it into myBName
if there is not a cd btn myBName then exit repeat
put "Sorry that message conflicts with something else on this card, please choose another message:" into myPrompt
end repeat
answer"Please drag a rectangle over the area you want your button to cover"
put sodaRect() into myRect
lock screen
choose tool 2
put the number of cd btns into myBNum
domenu "New Button"
put myBNum+1 into myBNum
if there is not a cd btn myBNum then
answer "Problem encountered. Please make sure you're on the card layer"
exit mouseUp
end if
set the textfont of cd btn myBNum to helvetica
set the textstyle of cd btn myBNum to "bold,condense,italic"
set the name of cd btn myBNum to myBName
set the rect of cd btn myBName to myRect
set the showname of cd btn myBName to true
set the style of cd btn myBName to opaque
set the autohilite of cd btn myBname to false
set the hilite of cd btn myBname to true
--Link Script:
put the script of bg btn "SODAPlugButt" into nuScript
put myScript into line 20 of nuScript
--Flashing rect whilst repositioning:
put " repeat until the mouseClick"&return into Repos
put "set the hilite of me to not the hilite of me"&return after Repos
put "set the hilite of me to not the hilite of me"&return after Repos
put Repos into line 5 of nuScript
--Now Insert the Script:
set the script of cd btn myBName to nuScript
--Inform user:
answer "•Option-Click on this button to re-position it."&return&¬
"•Command-Click to delete it"&return&"•Single-Click to run its script."&return&¬
"•Shift-Click to change Text & Fonts"
choose tool 1
end mouseUp
function buildScript
put" put 20 into myStart"&return after biff
put" put 56 into myStop"&return after biff
put" put 0 into myDelay"&return after biff
put" put 20 into mySteps"&return after biff
put" put 3 into myLoops"&return after biff
put" "&return after biff
put" if the shiftKey is down then"&return after biff
put" ask ""e&"Display what message?""e&" with the short name of me"&return after biff
put" if it is empty then exit mouseUp"&return after biff
put" set the name of me to it"&return after biff
put" "&return after biff
put" answer ""e&"What font?""e&" with ""e&"Times""e&" or ""e&"Palatino""e&" or ""e&"Helvetica""e&""&return after biff
put" set the textfont of me to it"&return after biff
put" "&return after biff
put" answer ""e&"Italicise?""e&"with ""e&"Yes""e&" or ""e&"No""e&""&return after biff
put" if it is ""e&"No""e&" then"&return after biff
put" set the textstyle of me to ""e&"Bold,Condense""e&""&return after biff
put" else"&return after biff
put" set the textstyle of me to ""e&"Bold,Italic,Condense""e&""&return after biff
put" end if"&return after biff
put" "&return after biff
put" ask ""e&"Start at what point-size?""e&" with myStart"&return after biff
put" if it is empty then exit mouseup"&return after biff
put" put it into meme"&return after biff
put" repeat with x=1 to the number of chars in meme"&return after biff
put" if the chartonum of meme>57 or the chartonum of meme<48 then exit mouseup"&return after biff
put" end repeat"&return after biff
put" put meme into myStart"&return after biff
put" "&return after biff
put" ask ""e&"Finish at what point-size?""e&" with myStop"&return after biff
put" if it is empty then exit mouseup"&return after biff
put" put it into meme"&return after biff
put" repeat with x=1 to the number of chars in meme"&return after biff
put" if the chartonum of meme>57 or the chartonum of meme<48 then exit mouseup"&return after biff
put" end repeat"&return after biff
put" put meme into myStop"&return after biff
put" "&return after biff
put" ask ""e&"How many steps?""e&" with mySteps"&return after biff
put" if it is empty then exit mouseup"&return after biff
put" put it into meme"&return after biff
put" repeat with x=1 to the number of chars in meme"&return after biff
put" if the chartonum of meme>57 or the chartonum of meme<48 then exit mouseup"&return after biff
put" end repeat"&return after biff
put" put meme into mySteps"&return after biff
put" "&return after biff
put" ask ""e&"What delay (in 60ths of a second) between updates?""e&" with myDelay"&return after biff
put" if it is empty then exit mouseup"&return after biff
put" put it into meme"&return after biff
put" repeat with x=1 to the number of chars in meme"&return after biff
put" if the chartonum of meme>57 or the chartonum of meme<48 then exit mouseup"&return after biff
put" end repeat"&return after biff
put" put meme into myDelay"&return after biff
put" "&return after biff
put" ask ""e&"Loop how many times?""e&" with ""e&"3""e&""&return after biff
put" if it is empty then exit mouseup"&return after biff
put" put it into meme"&return after biff
put" repeat with x=1 to the number of chars in meme"&return after biff
put" if the chartonum of meme>57 or the chartonum of meme<48 then exit mouseup"&return after biff
put" end repeat"&return after biff
put" put meme into myLoops"&return after biff
put" "&return after biff
put" answer ""e&"Text should be:""e&"with ""e&"Black""e&" or ""e&"White""e&""&return after biff
put" if it is ""e&"White""e&" then"&return after biff
put" set the hilite of me to true"&return after biff
put" else set the hilite of me to false"&return after biff
put" "&return after biff
put" "&return after biff
put" put the script of me into kooma"&return after biff
put" put myStart into word 2 of line 23 of kooma"&return after biff
put" put myStop into word 2 of line 24 of kooma"&return after biff
put" put myDelay into word 2 of line 25 of kooma"&return after biff
put" put mySteps into word 2 of line 26 of kooma"&return after biff
put" put myLoops into word 2 of line 27 of kooma"&return after biff
put" "&return after biff
put" set the script of me to kooma"&return after biff
put" set the textSize of me to myStart"&return after biff
put" exit mouseUp"&return after biff
put" end if"&return after biff
put" "&return after biff
put"repeat with loopIt=1 to myLoops"&return after biff
put"if myStart>myStop then"&return after biff
put"put trunc((myStart-myStop)/mySteps) into stepper"&return after biff
put"repeat with x=1 to mySteps"&return after biff
put"wait myDelay ticks"&return after biff
put"put myStart-stepper*x into jiff"&return after biff
put"set the textSize of me to jiff"&return after biff
put"end repeat"&return after biff
put"else"&return after biff
put"repeat with x=1 to mySteps"&return after biff
put"wait myDelay ticks"&return after biff
put"set the textSize of me to myStart+x*trunc(myStop/mySteps)"&return after biff
put"end repeat"&return after biff
put"end if"&return after biff
put"end repeat"&return after biff
return biff
end buildScript